<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./js/jquery.js"></script>
    <style>
        .box{
            width: 600px;
            height: 220px;
            display: flex;
            flex-wrap: wrap;
        }
        .item{
            width: 100px;
            height: 100px;
            border: 1px solid #000;
            margin: 0 2px;
        }
    </style>
</head>
<body>
    <div class="box">
        <div class="item"></div>
        <div class="item"></div>
        <div class="item"></div>
        <div class="item"></div>
        <div class="item"></div>
        <div class="item"></div>
        <div class="item"></div>
        <div class="item"></div>
        <div class="item"></div>
        <div class="item"></div>
    </div>
    <script>
        $(function(){
            // $(".item").each(function(index,item){
            //     $(item).css("backgroundColor","red").css("opacity",(index+1)/10)
            // })
            $(".item").map(function(index,item){
                $(item).css("backgroundColor","red").css("opacity",(index+1)/10)
            })
        })
    </script>
</body>
</html>